echo Content-type: text/html
rm out.py out.html
#echo embpy.sh $1
fn="$(basename $1)"
export PYTHONPATH=/root/embpy
if ! {
  ./embpy --input $1 --force 
} 2> /tmp/embpy.err.$$ >/tmp/embpy.log.$$ ; then
#   echo Content-type: text/html
   echo 
   echo \<pre\>\<b\>Embpy prefilter fails:\</b\>
   echo
   echo 
   cat /tmp/embpy.err.$$
   echo ===================
   cat /tmp/embpy.log.$$
fi
#if ! {
##  python PythonTidy.python /tmp/embpy.py.$$ /tmp/embpy.py2.$$
#  python /tmp/embpy.py.$$
#} 2> /tmp/embpy.py.err.$$ >/tmp/embpy.html.$$ ; then
##   echo Content-type: text/html
#   echo 
#   echo \<pre\>\<b\>Embpy python fails:\</b\>
#   echo
#   echo 
#   cat /tmp/embpy.py.err.$$
#   echo ===================
#   cat -n /tmp/embpy.py.$$
#fi
echo 
#echo  cache/$fn.html
tidy cache/$fn.html >/tmp/embpy.html2.$$
cat /tmp/embpy.html2.$$

echo \<hr\>Html Source:
echo \<br\>\<font size=-1 color=blue\>
sed 's/</\&lt;/g' < /tmp/embpy.html2.$$ | sed 's/>/\&gt;/g'  | sed '/^$/d' | sed 's/$/<br>/g' 
echo \<br\>\</font\>

echo \<hr\>Python Source:
echo \<pre\>
echo \<br\>\<font color=green size=-1\>
cat  cache/$fn.py | sed 's/</\&lt;/g'| sed 's/>/\&gt;/g'  | sed '/^$/d' | cat -n
echo \<br\>\</font\>

echo \<hr\>Embpy Source: $1
echo \<br\>\<font size=-1 color=brown\>
sed 's/</\&lt;/g' < /$1 | sed 's/>/\&gt;/g'  | sed '/^$/d' | cat -n
echo \<br\>\</font\>



rm /tmp/embpy.py.$$ /tmp/embpy.py2.$$ /tmp/embpy.html.$$ /tmp/embpy.err.$$ /tmp/embpy.py.err.$$ /tmp/embpy.log.$$ /tmp/embpy.pyc